﻿using UnityEngine;
using System.Collections;

public class ShotSpawnBoss : MonoBehaviour {

	public GameObject[] bullet;
	public Transform shotTransform;
	float time = 0.0f;
	public float interval = 1f;

	// Update is called once per frame
	void Update () {
		if (Time.time - time > interval ){
			int RandomIndex = Random.Range(0, bullet.Length);
			Debug.Log(RandomIndex);
			GameObject ob = Instantiate (bullet[RandomIndex]) as GameObject;
			ob.transform.position = shotTransform.position;
			ob.rigidbody2D.velocity = new Vector2(Random.Range(-1.0f, 1.0f), 3);
			time = Time.time;
		}


	}
}
